#include "ScnsTimer.c.h"

#if defined(SCNS_TIMER_ENABLE)&&SCNS_TIMER_ENABLE==1

ScnsStatus scnsBspTimerInit(void)
{
    return (HAL_RCC_GetSysClockFreq()==((uint32)(((double)1e9)*SCNS_BSP_TIMER_NS_TO_TICK)))?SCNS_STATUS_OK:SCNS_STATUS_BSP_FAILED;
}

void scnsBspTimerFinishInit(void)
{
    LL_SYSTICK_EnableIT();
}

uint64 scnsBspTimerGetSysTickVal(void)
{
    return (SysTick->LOAD-SysTick->VAL);
}

uint64 scnsBspTimerGetSysTickLoad(void)
{
    return (SysTick->LOAD);
}

#endif
